import request from "@/utils/requestPro.js";


// 获取全部商户分类列表
export function getMerCategoryListApi() {
	return request({
		url: '/admin/merchant/all/category/list',
		method: 'get',
	});
}

// 获取全部商户类型列表
export function getMerTypeListApi() {
	return request({
		url: '/admin/merchant/all/type/list',
		method: 'get',
	});
}

// 商户入驻申请
export function MerApplyApi(data) {
	return request({
		url: '/admin/merchant/settled/apply',
		method: 'post',
		data,
	});
}

// 商户入驻申请回显数据
export function applyEchoAPi() {
	return request({
		url: '/admin/merchant/apply/get',
		method: 'get',
	});
}

// 获取商户入驻法人信息
export function legalPersonApi() {
	return request({
		url: '/admin/merchant/apply/behalf/get',
		method: 'get',
	});
}
// 修改商户入驻法人申请信息
export function updateLegalPersonApi(data) {
	return request({
		url: '/admin/merchant/apply/behalf/update',
		method: 'put',
		data,
	});
}

// 获取商户入驻信息
export function getBasicApi() {
	return request({
		url: '/admin/merchant/apply/basic/get',
		method: 'get',
	});
}


// 修改商户入驻申请信息
export function basicUpdateApi(data) {
	return request({
		url: '/admin/merchant/apply/basic/update',
		method: 'put',
		data,
	});
}



// 回显经营信息
export function selectManageInfoApi() {
	return request({
		url: '/admin/manageInfo/selectManageInfoById',
		method: 'get',
	});
}

// 添加经营信息

export function updateManageInfoApi(params) {
	return request({
		url: '/admin/manageInfo/updateManageInfo',
		method: 'put',
		params,
	});
}

/**
 * @description 商户基本设置 -- 配置信息
 */
export function merchantConfigInfoApi() {
  return request({
    url: '/admin/merchant/config/info',
    method: 'get',
  });
}

/**
 * @description 商户基本设置 -- 商户详情
 */
export function getBaseInfoApi() {
  return request({
    url: '/admin/merchant/base/info',
    method: 'get',
  });
}

/**
 * @description 商户基本设置 -- 提交
 */
export function merchantUpdateApi(data) {
  return request({
    url: '/admin/merchant/config/info/edit',
    method: 'post',
    data,
  });
}

/**
 * 修改登录用户信息
 * @param data
 */
export function adminAccountUpdate(pram) {
  const data = {
    password: pram.password,
    realName: pram.realName,
  };
  return request({
    url: '/admin/merchant/login/admin/update',
    method: 'POST',
    data,
  });
}


/**
 * 优惠券分页列表
 * 
 */
export function couponListdate(params) {
  return request({
    url: '/admin/merchant/coupon/list',
    method: 'GET',
	params
  });
}

/**
 * 删除优惠券
 * 
 */
export function couponDeletedate(id) {
  return request({
    url: `/admin/merchant/coupon/delete/${id}`,
    method: 'POST',
  });
}

/**
 * 修改优惠券状态
 * 
 */
export function couponUpdateStatus(id) {
  return request({
    url: `/admin/merchant/coupon/update/status/${id}`,
    method: 'POST',
  });
}

/**
 * 新增优惠券
 * 
 */
export function saveCoupondata(data) {
  return request({
    url: `/admin/merchant/coupon/save`,
    method: 'POST',
	data,
  });
}

/**
 * 优惠券领取记录
 * 
 */
export function userCouponListApi(params) {
  return request({
    url: `/admin/merchant/coupon/user/list`,
    method: 'GET',
	params,
  });
}

/**
 * 城市tree区域管理
 * 
 */
export function cityRegionTreeApi(params) {
  return request({
    url: `/admin/merchant/city/region/city/tree`,
    method: 'GET',
	params,
  });
}

/**
 * 查询物资规格列表
 * 
 */
export function getSpecListApi(params) {
  return request({
    url: `/admin/materialDet/specifications/get/list`,
    method: 'GET',
	params,
  });
}

/**
 * 添加物资规格
 * 
 */
export function addSpecificeApi(params) {
  return request({
    url: `/admin/materialDet/specifications/add`,
    method: 'POST',
	params,
  });
}

/**
 * 查询物资单位列表
 * 
 */
export function getUnitListApi(params) {
  return request({
    url: `/admin/materialDet/unit/get/list`,
    method: 'GET',
	params,
  });
}

/**
 * 添加物资单位
 * @param
 */
export function addUnitListApi(params) {
  return request({
    url: `/admin/materialDet/unit/add`,
    method: 'POST',
	params,
  });
}
